import request from '@/utils/request'

/**
 * 
 * @param {算法模型接口} data 
 * @returns 
 */

//算法模型分页查询
export const getList = (data) => {
  return request({
    url: '/algor-model/selectByCondition?currentPage=' + data.currentPage + '&size=' + data.size + '&algorName=' + data.algorName,
    method: 'get'
  })
}

//查询可视化数据选中列字段
export const getColumns = (data) => {
  return request({
    url: '/algor-model/selectVisualFields?ids=' + data,
    method: 'get'
  })
}

//回显可视化数据选中列
export const selectByIds = (data) => {
  return request({
    url: '/visual-data/selectByIds?ids=' + data,
    method: 'get'
  })
}

//新增算法模型数据
export const insertAlgor = (data) => {
  return request({
    url: '/algor-model/insert',
    method: 'post',
    data
  })
}


//查询算法模型单条数据
export const selectOne = (data) => {
  return request({
    url: '/algor-model/selectOne?id=' + data.id,
    method: 'get',
  })
}

//编辑算法模型数据
export const updateAlgor = (data) => {
  return request({
    url: '/algor-model/updateByCondition',
    method: 'post',
    data,
  })
}

//批量删除算法模型
export const delateAlgor = (data) => {
  return request({
    url: '/algor-model/batchDelete',
    method: 'post',
    data
  })
}

//新增查询算法模型名称重命名效验
export const insertRules = (data) => {
  return request({
    url: '/algor-model/existsAlgorName?algorName='+data,
    method: 'get',
  })
}
